﻿using HomagGroup.Base.UI;
using HomagChina.CCT.BaseUI.ViewModel;
using HomagChina.CCT.BaseUI.DataModel;
using HomagGroup.Base.UI.Themes.Resources;
using System.Collections.ObjectModel;
using static HomagChina.CCT.BaseUI.ProcessResourceInternal;
using static HomagChina.CCT.BaseUI.Utility;
using Application = System.Windows.Application;
using localText = HomagChina.Basic.CCT.ResourceLibrary.Properties.Resources;
using UserControl = System.Windows.Controls.UserControl;
using HomagGroup.BaseUI.Router;

namespace HomagChina.CCT.BaseUI.Router
{
    public class SettingsRoute
    {
        public RouterItemDataModel SettingsRouteModel { get; set; }

        public SettingsRoute()
        {
            SettingsViewModel settingsViewModel = new SettingsViewModel();
            SettingsRouteModel = new RouterItemDataModel()
            {
                ID = "Settings",
                viewLabel = localText.Settings,
                viewName = "Settings",
                keepalive = false,
                viewModelName = "SettingsViewModel",
                ViewModel = settingsViewModel,
                userControl = (UserControl)GetUserControlInstance("Settings"),
                Image = null,
                functionKeyBarItems = new ObservableCollection<FunctionKeyBarItemDataModel>
                {
                    new FunctionKeyBarItemDataModel() {
                        Header=localText.Help, Position = 3, Icon = GetIconBrush(Icon.Help),
                        Command = new RelayCommand(settingsViewModel.test)},
                    new FunctionKeyBarItemDataModel() {
                        Header = localText.Exit, Position = 12, Icon = GetIconBrush(Icon.Close, ImageDecoration.Circle),
                        Command = new RelayCommand(() => { Application.Current.Shutdown(); })},
                    new FunctionKeyBarItemDataModel() {
                        Header = localText.Error_message, Position = 11, Icon = GetResourceBrush("ErrorMessages"),
                        Command = new RelayCommand(()=>{ NavigateServices.Instance.NavigateTo("ErrorMessage"); })
                    },
                    //new FunctionKeyBarItemDataModel() {
                    //    Header = localText.Info, Position = 1, Icon = GetIconBrush(Icon.Information, imageDecoration: ImageDecoration.Circle),
                    //    Command = new RelayCommand(() => { Handle_Common.OpenInformationCommand(Handle_Search.GetSystemInfoMation()); })}
                }
            };
            SettingsRouteModel.userControl.DataContext = SettingsRouteModel.ViewModel;
        }
    }
}